﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.IO;

namespace CleanBackup.Helpers
{
	class PathValidationRule : ValidationRule
	{
		public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
		{
			string path = (string)value;

			if (!Directory.Exists(@path))
				return new ValidationResult(false, "Invalid path.");

			return new ValidationResult(true, null);
		}
	}
}
